﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Vortex.Resources {

	/// <summary>
	/// Generic resource exception
	/// </summary>
	public class ResourceException : Exception {
		/// <summary>
		/// Initializes a new instance of the <see cref="StyleSheetException"/> class.
		/// </summary>
		/// <param name="cause">The source exception caused this one.</param>
		/// <param name="format">The format of message.</param>
		/// <param name="args">The args.</param>
		public ResourceException(Exception cause, string format, params object[] args)
			: base(string.Format(format, args), cause) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="StyleSheetException"/> class.
		/// </summary>
		/// <param name="format">The format of message.</param>
		/// <param name="args">The args.</param>
		public ResourceException(string format, params object[] args)
			: base(string.Format(format, args)) {
		}
	}

	/// <summary>
	/// Exception of resource file parsing
	/// </summary>
	public class ResourceFileParseException : ResourceException {
		/// <summary>
		/// Initializes a new instance of the <see cref="StyleSheetException"/> class.
		/// </summary>
		/// <param name="cause">The source exception caused this one.</param>
		/// <param name="format">The format of message.</param>
		/// <param name="args">The args.</param>
		public ResourceFileParseException(Exception cause, string format, params object[] args)
			: base(cause, format, args) {
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="StyleSheetException"/> class.
		/// </summary>
		/// <param name="format">The format of message.</param>
		/// <param name="args">The args.</param>
		public ResourceFileParseException(string format, params object[] args)
			: base(format, args) {
		}
	}
}
